// default package
// Generated 28 Jul, 2014 8:04:07 PM by Hibernate Tools 3.4.0.CR1
package com.galaxy.bean;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * PersistentSession generated by hbm2java
 */
@Entity
@Table(name = "persistent_session", catalog = "magento", uniqueConstraints = {
		@UniqueConstraint(columnNames = "key"),
		@UniqueConstraint(columnNames = "customer_id") })
public class PersistentSession implements java.io.Serializable {

	private Integer persistentId;
	private CoreWebsite coreWebsite;
	private CustomerEntity customerEntity;
	private String key;
	private String info;
	private Date updatedAt;

	public PersistentSession() {
	}

	public PersistentSession(CoreWebsite coreWebsite, String key) {
		this.coreWebsite = coreWebsite;
		this.key = key;
	}

	public PersistentSession(CoreWebsite coreWebsite,
			CustomerEntity customerEntity, String key, String info,
			Date updatedAt) {
		this.coreWebsite = coreWebsite;
		this.customerEntity = customerEntity;
		this.key = key;
		this.info = info;
		this.updatedAt = updatedAt;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "persistent_id", unique = true, nullable = false)
	public Integer getPersistentId() {
		return this.persistentId;
	}

	public void setPersistentId(Integer persistentId) {
		this.persistentId = persistentId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "website_id", nullable = false)
	public CoreWebsite getCoreWebsite() {
		return this.coreWebsite;
	}

	public void setCoreWebsite(CoreWebsite coreWebsite) {
		this.coreWebsite = coreWebsite;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "customer_id", unique = true)
	public CustomerEntity getCustomerEntity() {
		return this.customerEntity;
	}

	public void setCustomerEntity(CustomerEntity customerEntity) {
		this.customerEntity = customerEntity;
	}

	@Column(name = "key", unique = true, nullable = false, length = 50)
	public String getKey() {
		return this.key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	@Column(name = "info", length = 65535)
	public String getInfo() {
		return this.info;
	}

	public void setInfo(String info) {
		this.info = info;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "updated_at", length = 19)
	public Date getUpdatedAt() {
		return this.updatedAt;
	}

	public void setUpdatedAt(Date updatedAt) {
		this.updatedAt = updatedAt;
	}

}
